package com.hup.vd.model.config;

import com.alibaba.fastjson.annotation.JSONField;
import com.hup.utils.commons.io.BaseConfig;
import com.hup.utils.swing.model.BaseWindowConfig;
import com.hup.vd.constant.TaskConstant.SortType;
import lombok.Data;

/**
 * @author hugan
 * @date 2022/1/11
 */
@Data
public class AppConfig implements BaseConfig<AppConfig> {

    private BaseWindowConfig windowConfig = new BaseWindowConfig();

    private DownloadConfig downloadConfig = new DownloadConfig();

    private String lastUrl;
    /**
     * 上次文件保存路径
     */
    private String lastSavePath;
    /**
     * chromeDriver路径
     */
    private String chromeDriverPath;
    /**
     * 下次抓取m3u8链接失败后,导出chrome的请求日志
     */
    @JSONField(serialize = false)
    public boolean exportChromeLog;

    /**
     * 排序方式
     */
    private String downloadSortType = SortType.CREATE_DESC.name;
    private String finishSortType = SortType.FINISH_DESC.name;

    /**
     * 批量创建的配置
     */
    private String clusterFilePath;
    private Integer clusterNumSt;

    @Override
    public boolean afterLoadFromFileOrReset(AppConfig fileConfig) {
        return fileConfig == null;
    }
}
